<?php $articulo = $form->getObject() ?>
<h3><?php echo $articulo->isNew() ? 'Nuevo' : 'Editar' ?> Artículo</h3>

<form action="<?php echo url_for('inventario/update'.(!$articulo->isNew() ? '?id='.$articulo->getId() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
  <table>
    <tfoot>
      <tr>
        <td colspan="2">
          &nbsp;<a href="<?php echo url_for('inventario/index') ?>">Cancel</a>
          <?php if (!$articulo->isNew()): ?>
            &nbsp;<?php echo link_to('Delete', 'inventario/delete?id='.$articulo->getId(), array('post' => true, 'confirm' => 'Are you sure?')) ?>
          <?php endif; ?>
          <input type="submit" value="Save" />
        </td>
      </tr>
    </tfoot>
    <tbody>
      <?php echo $form->renderGlobalErrors() ?>
      <tr>
        <th><?php echo $form['proveedor_id']->renderLabel() ?></th>
        <td>
          <?php echo $form['proveedor_id']->renderError() ?>
          <?php echo $form['proveedor_id'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['descuento_id']->renderLabel() ?></th>
        <td>
          <?php echo $form['descuento_id']->renderError() ?>
          <?php echo $form['descuento_id'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['categoria_id']->renderLabel() ?></th>
        <td>
          <?php echo $form['categoria_id']->renderError() ?>
          <?php echo $form['categoria_id'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['codigo']->renderLabel() ?></th>
        <td>
          <?php echo $form['codigo']->renderError() ?>
          <?php echo $form['codigo'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['descripcion']->renderLabel() ?></th>
        <td>
          <?php echo $form['descripcion']->renderError() ?>
          <?php echo $form['descripcion'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['foto']->renderLabel() ?></th>
        <td>
          <?php echo image_tag('fotos/'.$form['foto']->getvalue()) ?>
          <?php echo $form['foto']->renderError() ?>
          <?php echo $form['foto'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['existencia']->renderLabel() ?></th>
        <td>
          <?php echo $form['existencia']->renderError() ?>
          <?php echo $form['existencia'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['costo']->renderLabel() ?></th>
        <td>
          <?php echo $form['costo']->renderError() ?>
          <?php echo $form['costo'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['precio']->renderLabel() ?></th>
        <td>
          <?php echo $form['precio']->renderError() ?>
          <?php echo $form['precio'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['color']->renderLabel() ?></th>
        <td>
          <?php echo $form['color']->renderError() ?>
          <?php echo $form['color'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['talla']->renderLabel() ?></th>
        <td>
          <?php echo $form['talla']->renderError() ?>
          <?php echo $form['talla'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['reorden']->renderLabel() ?></th>
        <td>
          <?php echo $form['reorden']->renderError() ?>
          <?php echo $form['reorden'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['tiempo_entrega']->renderLabel() ?></th>
        <td>
          <?php echo $form['tiempo_entrega']->renderError() ?>
          <?php echo $form['tiempo_entrega'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['fecha_compra']->renderLabel() ?></th>
        <td>
          <?php echo $form['fecha_compra']->renderError() ?>
          <?php echo $form['fecha_compra'] ?>
          

        <?php echo $form['id'] ?>
        </td>
      </tr>
    </tbody>
  </table>
</form>
